ls -1 | wc -l
Also if want to count only certain pattern:
ls -1 *.pdf | wc -l
Or by regex pattern via grep.
ls -1 *.log | wc -l